<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>background</title>
  <style>
    .img {
      height: 300px;
      /* background-color: burlywood; */
      background-image: url(img/bg.png);
      background: rgba(0, 0, 0, .3);
      /* 取消平铺 */
      background-repeat: no-repeat;
      /* background-position: top right; */
      background-position: center;
    }

    h2 {
      width: 190px;
      height: 54px;
      line-height: 54px;
      font-weight: 400;
      font-size: 20px;
      /* background-color: antiquewhite; */
      background-image: url(img/milogo.png);
      background-repeat: no-repeat;
      background-position: left center;
      text-indent: 3em;
    }

    body {
      /* background-image: url(img/header-bg.jpg);
      background-repeat: no-repeat;
      background-position: center top;*/
      /* 背景附着属性: 固定 fixed 或者滚动 scroll */
      /* background-attachment: fixed; */
      /* 使样式优先级变高，突破样式加载顺序/覆盖顺序 */
      background-size: 100% !important;
      /* 提倡使用复合写法 */
      background: transparent url(img/header-bg.jpg) no-repeat fixed center top;
    }
  </style>
</head>

<body>
  <div class="img"></div>
  <h2>注册小米账号</h2>
  <p>Lorem ipsum dolor sit amet</p>
  <p>Lorem ipsum dolor sit amet</p>
  <p>Lorem ipsum dolor sit amet</p>
  <p>Lorem ipsum dolor sit amet</p>
  <p>Lorem ipsum dolor sit amet</p>
  <p>Lorem ipsum dolor sit amet</p>
  <p>Lorem ipsum dolor sit amet</p>
  <p>Lorem ipsum dolor sit amet</p>
  <p>Lorem ipsum dolor sit amet</p>
  <p>Lorem ipsum dolor sit amet</p>
  <p>Lorem ipsum dolor sit amet</p>
  <p>Lorem ipsum dolor sit amet</p>
  <p>Lorem ipsum dolor sit amet</p>
  <p>Lorem ipsum dolor sit amet</p>
  <p>Lorem ipsum dolor sit amet</p>
  <p>Lorem ipsum dolor sit amet</p>
  <p>Lorem ipsum dolor sit amet</p>
  <p>Lorem ipsum dolor sit amet</p>
  <p>Lorem ipsum dolor sit amet</p>
  <p>Lorem ipsum dolor sit amet</p>
  <p>Lorem ipsum dolor sit amet</p>
  <p>Lorem ipsum dolor sit amet</p>
  <p>Lorem ipsum dolor sit amet</p>
  <p>Lorem ipsum dolor sit amet</p>
  <p>Lorem ipsum dolor sit amet</p>
  <p>Lorem ipsum dolor sit amet</p>
  <p>Lorem ipsum dolor sit amet</p>
  <p>Lorem ipsum dolor sit amet</p>
  <p>Lorem ipsum dolor sit amet</p>
  <p>Lorem ipsum dolor sit amet</p>
  <p>Lorem ipsum dolor sit amet</p>
  <p>Lorem ipsum dolor sit amet</p>
</body>

</html>